﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace AuthApi.Contracts
{
    [Serializable]
    [DataContract]
    public class OperationIncluded
    {
        public OperationIncluded()
        {
            RoleIncluded = new List<RoleIncluded>();
        }

        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public int ApplicationId { get; set; }

        [DataMember]
        public string ApplicationName { get; set; }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Description { get; set; }

        [DataMember]
        public bool IsIncluded { get; set; }

        [DataMember]
        public List<RoleIncluded> RoleIncluded { get; set; }

        public string DisplayName
        {
            get
            {
                if (Description == null) Description = string.Empty;

                return string.Format("{0}({1})", Description, Name);
            }
        }
    }
}
